<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Promise 测试</title>
  </head>
  <body>
    <script>
      function p1 () {
        return new Promise(function (resolve, reject) {
          reject('hello');
        })
      }
      p1()
        .then(value => console.log(value))
        .catch(reason => console.log(reason))
    </script>
  </body>
</html>
